<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateGiftBatchLogTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('gift_batch_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('赠送用户ID');
            $table->string('receive_user_id', 100)->default('')->comment('接收用户ID,多个');
            $table->smallInteger('gift_id')->default(0)->comment('礼物ID');
            $table->tinyInteger('gift_type')->default(0)->comment('礼物类型:1-普通礼物,2-系统礼物');
            $table->tinyInteger('flag')->default(1)->comment('状态:1-已发送,0-发送失败');
            $table->timestamps();
            $table->index('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('gift_batch_log');
    }
}
